<?php

/**
 * Description of PersonPersonClass
 *
 * @author adhamhelal
 */
class OrgPersonPanel extends Qpanel {
	protected $objOrg;

            //Controls
        protected $strTemplate;
        protected $dtgPeople;

        public function __construct($objParentObject, $objOrg, $strControlId = null) {
                // Call the Parent
                try {
                        parent::__construct($objParentObject, $strControlId);
                } catch (QCallerException $objExc) {
                        $objExc->IncrementOffset();
                        throw $objExc;
                }

                // Setup Template
                $this->strTemplate = __DOCROOT__.__PERSON__ .  '/tpl/qpanel.tpl.php';
                // Set the Person Meta Conrol
                $this->objOrg = $objOrg;

                // Call MetaControl's methods to create qcontrols based on ComSchool's data fields
                 $this->dtgPeople = new PersonDataGrid($this);

                $this->dtgPeople->AdditionalConditions = QQ::Equal(QQN::Person()->OrgId , $this->objOrg->Id ) ;
                $this->dtgPeople->CssClass = 'datagrid';
                $this->dtgPeople->AlternateRowStyle->CssClass = 'alternate';

                $this->dtgPeople->Paginator = new QPaginator($this->dtgPeople);
                $this->dtgPeople->ItemsPerPage = 20;

           //     $this->dtgPeople->AddRowAction(new QMouseOverEvent(), new QCssClassAction('selectedStyle'));
             //   $this->dtgPeople->AddRowAction(new QMouseOutEvent(), new QCssClassAction());

                $this->dtgPeople->RowActionParameterHtml = '<?= $_ITEM->Id ?>';
              //  $this->dtgPeople->AddRowAction(new QClickEvent(), new QAjaxAction('dtgPeopleRow_Click'));

                $this->dtgPeople->MetaAddColumn('FirstName');
                $this->dtgPeople->MetaAddColumn('LastName');


    }

    public function Validate() {
        $blnToReturn = true;


        return $blnToReturn;
    }




}
?>

